//
//  LTView.m
//  DoubanDemo1
//
//  Created by lanou3g on 15/11/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "LTView.h"

@implementation LTView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self allViews];
    }
    return self;
}

- (void)allViews
{
    CGFloat selfWidth = self.frame.size.width;
    CGFloat selHeight = self.frame.size.height;
    
    CGFloat labelWidth = selfWidth/3;
    CGFloat labelHeight = selHeight;
    
    CGFloat textFieldWidth = selfWidth - labelWidth;
    CGFloat textFieldHeight = labelHeight;
    
    
    
    self.label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, labelWidth, labelHeight)];
    self.label.text = @"用户名:";
//    self.label.backgroundColor = [UIColor yellowColor];
//    self.label.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.label];
    
    self.textField = [[UITextField alloc]initWithFrame:CGRectMake(labelWidth, 0, textFieldWidth, textFieldHeight)];
    self.textField.placeholder = @"请输入用户名";
    self.textField.clearButtonMode = YES;
    self.textField.borderStyle = UITextBorderStyleRoundedRect;
//    self.textField.backgroundColor = [UIColor redColor];
    [self addSubview:self.textField];
}

@end
